package com.scau.phradmin.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scau.phradmin.domain.entity.Newhospital;
import com.scau.phradmin.domain.entity.Newhospital;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yuzhiyi
 * @since 2018-08-05
 */
@Component
public interface NewhospitalMapper extends BaseMapper<Newhospital> {
    /**
     * 查找所有表单（分页）
     * @param page 分页记录
     * @return
     */
    @Select("select * " +
            "from " +
            "newhospital " +
            "order by id "
    )
    List<Newhospital> queryAll(IPage page);

    /**
     * 查询唯一记录
     * @param id
     * @return
     */
    @Select("select * " +
            "from " +
            "newhospital " +
            "where id=#{id};")
    Newhospital queryOne(Integer id);

    @Delete("delete * from newhospital where id=#{id}")
    Integer deleteById(Long id);
}
